package com.one.exception;

import org.springframework.stereotype.Component;

/**
 * @ClassName: MyException
 * @Date: 2022/1/14 10:17
 * @Description: 自定义异常
 */
public class MyException extends Exception {

    /**
     * 系统自动生成序列号
     */
    private static final long serialVersionUID = 6164460094705302419L;

    public MyException() {
        super();
    }

    public MyException(String message) {
        super(message);
    }

    public MyException(String message, Throwable cause) {
        super(message, cause);
    }

    public MyException(Throwable cause) {
        super(cause);
    }

    protected MyException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    private MyExceptionEnum myExceptionEnum;


    /**
     * @Date: 2022/1/14 10:24
     * @return: 
     * @Description: 带参构造方法
    */
    public MyException(MyExceptionEnum myExceptionEnum) {
        this.myExceptionEnum = myExceptionEnum;
    }

    /**
     * @Author: yph
     * @Date: 2022/1/14 10:27
     * @return: 
     * @Description: 返回自定义异常枚举
    */
    public MyExceptionEnum bbsExceptionEnum() {
        return this.myExceptionEnum;
    }

}
